package Day15.poly_.six.Testpro;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/22 17:49
 */
public class Student extends Person{
    private double freeMoney;//零花钱

    public Student(String name, int age, double freeMoney) {
        super(name, age);
        this.freeMoney = freeMoney;
    }

    public double getFreeMoney() {
        return freeMoney;
    }

    public void setFreeMoney(double freeMoney) {
        this.freeMoney = freeMoney;
    }

    @Override
    public String say() {
        return super.say()+"，零花钱是："+freeMoney;
    }
    public void study(){
        System.out.println("学生："+getName()+"，正在学习数据结构。");
    }
}
